
#!/bin/bash
DATE=$(date +%F_%T)

PROJECT_NAME=sw-lmsc
WORK_DIR=/opt/source
SOURCE_WORD_DIR=$WORK_DIR/$PROJECT_NAME

echo $SOURCE_WORD_DIR

# 拉取代码
cd $SOURCE_WORD_DIR
git pull

# 构建
mvn clean package -Dmaven.test.skip=true
if [ $? -ne 0 ]; then
   echo "maven build failure!"
   exit 1
fi

cp -f /opt/source/$PROJECT_NAME/target/*.jar /opt/qypay/sw-lmsc/.

cd /opt/qypay/sw-lmsc/
sh springboot_*.sh restart
